# coding:utf-8
# name ：YuFuXiao
# date : 2018-9-XX
import requests

class HTTP():
    @staticmethod
    def get(url,return_json=True):   #get请求
        r = requests.get(url)
        if r.status_code == 200:
            return r.json() if return_json else r.text
        else:
            return {} if return_json else ''

        # if r.status_code == 200:
        #     if return_json:
        #         result = r.json()
        #     else:
        #         result = r.text
        #     return result
        # else:
        #     if return_json:
        #         result = {}
        #     else:
        #         result = ''
        #     return result
